/*
 * 
 */
package model;

import view.PersonObserver;

/**
 *
 */
public class PersonInfo implements Person {
    /**
     * 
     */
    enum Role {Contestant, Judge, Organizer};
    /**
     * 
     */
    private PersonObserver my_personObserver;
    /**
     * 
     */
    private String my_email;
    /**
     * 
     */
    private String my_password;
    /**
     * 
     */
    private Role my_role;
    /**
     * 
     */
    private String my_first_name;
    /**
     * 
     */
    private String my_last_name;
    /**
     * 
     */
    private String my_phone_number;
    /**
     * Initial state before a person logs in or registers.
     */
    public PersonInfo() {
        this(null, null);
    }
    /**
     * Default role is a contestant unless otherwise specified.
     * String the_name is just a placeholder for whatever data structure
     * is generated by the repository. 
     */
    public PersonInfo(String the_name) {
        this(Role.Contestant, the_name);
    }
    /**
     * 
     */
    public PersonInfo(Role the_role, String the_name) {
        my_role = the_role;
        my_first_name = the_name;
    }
    /**
     * {@inheritDoc}
     */
    @Override
    public void addPerson() {
        //notifyObserver(person);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void removePerson() {

    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void getByLogin() {
        //notifyObservers(person);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void getByEmail() {
        //notifyObserver(person);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void getByRole() {

    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void getAll() {
 
    }
    @Override
    public void setObserver(PersonObserver the_observer) {
        my_personObserver = the_observer;   
    }
    //Can overload this method and updatePerson for different notifications.
    //For example, having a boolean is a parameter for the removePerson method.
    public void notifyObserver(Person the_person) {
        my_personObserver.updatePerson(the_person);
    }
}
